'use strict';
const unipay = require('uni-pay')
exports.main = async (event, context) => {
	//event为客户端上传的参数
	console.log('event : ', event)
	const payInfo = unipay.initWeixin({
		appId:"wxa12be3aa044494d5",
		mchId:"1667323158",
		key:"3C7B53918728417C45D12E6D45FB2CD7"
	});
	let orderInfo = await payInfo.getOrderInfo({
		openid:event.openId,
		body:event.payTitle,
		outTradeNo:event.orderId,
		totalFee:event.payPrice,
		notify_url:"https://api.idianyidian.com/uni-pay-co"
	});
	//返回数据给客户端
	return orderInfo;
};
